/*
 * @(#) $Header$
 *
 * Copyright (C) 2007  Forklabs Daniel Léonard
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */

package ca.forklabs.media.jai.operator;

import java.text.MessageFormat;
import java.util.ResourceBundle;
import ca.forklabs.baselib.util.CharsetPropertiesControl;

/**
 * Class {@code Resources} is the default bundle for the resources used by
 * classes in the {@link ca.forklabs.media.jai.operator} package.
 *
 * @author   <a href="mailto:forklabs at gmail.com?subject=ca.forklabs.media.jai.operator.Resources">Daniel Léonard</a>
 * @version $Revision$
 */
class Resources {
// TODO : with many packages, merge all the resource files together ?
//---------------------------
// Class variables
//---------------------------

   /** Key for the description of the median collection operation. */
   public static final String UNARY_FUNCTION_DESCRIPTION = "unary.function.description"; //$NON-NLS-1$
   /** Key for the description of the median collection operation. */
   public static final String UNARY_FUNCTION_ARG0_DESCRIPTION = "unary.function.arg0.description"; //$NON-NLS-1$

   /** Key for the description of the pipeline operation. */
   public static final String PIPELINE_DESCRIPTION = "pipeline.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String PIPELINE_ARG0_DESCRIPTION = "pipeline.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String PIPELINE_ARG1_DESCRIPTION = "pipeline.arg1.description"; //$NON-NLS-1$
   /** Key for the error message saying that there are not the same number of operations and parameter blocks. */
   public static final String PIPELINE_BAD_ALIGNEMENT = "pipeline.bad.alignment"; //$NON-NLS-1$

   /** Key for the description of the auto rescale operation. */
   public static final String AUTO_RESCALE_DESCRIPTION = "auto.rescale.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String AUTO_RESCALE_ARG0_DESCRIPTION = "auto.rescale.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */   /** Key for the error message saying that there are no lower bounds. */
   public static final String AUTO_RESCALE_ARG1_DESCRIPTION = "auto.rescale.arg1.description"; //$NON-NLS-1$
   /** Key for the error message saying that there are no lower bounds. */
   public static final String AUTO_RESCALE_NO_LOWER_BOUNDS = "auto.rescale.no.lower.bounds"; //$NON-NLS-1$
   /** Key for the error message saying that there are no upper bounds. */
   public static final String AUTO_RESCALE_NO_UPPER_BOUNDS = "auto.rescale.no.upper.bounds"; //$NON-NLS-1$
   /** Key for the error message saying that they are not the same number of lower and upper bounds. */
   public static final String AUTO_RESCALE_NOT_SAME_NUMBER_OF_BOUNDS = "auto.rescale.not.same.number.of.bounds"; //$NON-NLS-1$
   /** Key for the error message saying that the lower bound is greater than the upper bound. */
   public static final String AUTO_RESCALE_LOWER_GREATER_THAN_UPPER = "auto.rescale.lower.greater.than.upper"; //$NON-NLS-1$

   /** Key for the description of the apply to collection operation. */
   public static final String APPLY_TO_COLLECTION_DESCRIPTION = "apply.to.collection.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String APPLY_TO_COLLECTION_ARG0_DESCRIPTION = "apply.to.collection.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String APPLY_TO_COLLECTION_ARG1_DESCRIPTION = "apply.to.collection.arg1.description"; //$NON-NLS-1$

   /** Key for the description of the dft3d operation. */
   public static final String DFT3D_DESCRIPTION = "dft3d.description"; //$NON-NLS-1$
   /** Key for the description of the idft3d operation. */
   public static final String IDFT3D_DESCRIPTION = "idft3d.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String DFT3D_ARG0_DESCRIPTION = "dft3d.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String DFT3D_ARG1_DESCRIPTION = "dft3d.arg1.description"; //$NON-NLS-1$

   /** Key for the description of the dft3d operation. */
   public static final String PERIODIC_SHIFT_3D_DESCRIPTION = "periodic.shift.3d.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String PERIODIC_SHIFT_3D_ARG0_DESCRIPTION = "periodic.shift.3d.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String PERIODIC_SHIFT_3D_ARG1_DESCRIPTION = "periodic.shift.3d.arg1.description"; //$NON-NLS-1$
   /** Key for the description of the third argument. */
   public static final String PERIODIC_SHIFT_3D_ARG2_DESCRIPTION = "periodic.shift.3d.arg2.description"; //$NON-NLS-1$

   /** Key for the description of the median collection operation. */
   public static final String MEDIAN_COLLECTION_DESCRIPTION = "median.collection.description"; //$NON-NLS-1$
   /** Key for the error message telling that 2+ images are required. */
   public static final String MEDIAN_COLLECTION_CARDINALITY = "median.collection.cardinality"; //$NON-NLS-1$

   /** Key for the description of the spatial homomorphic operation. */
   public static final String SPECTRAL_HOMOMORPHIC_DESCRIPTION = "spectral.homomorphic.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String SPECTRAL_HOMOMORPHIC_ARG0_DESCRIPTION = "spectral.homomorphic.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String SPECTRAL_HOMOMORPHIC_ARG1_DESCRIPTION = "spectral.homomorphic.arg1.description"; //$NON-NLS-1$

   /** Key for the description of the spatial homomorphic operation. */
   public static final String SPECTRAL_FILTER_DESCRIPTION = "spectral.filter.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String SPECTRAL_FILTER_ARG0_DESCRIPTION = "spectral.filter.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String SPECTRAL_FILTER_ARG1_DESCRIPTION = "spectral.filter.arg1.description"; //$NON-NLS-1$

   /** Key for the description of the image function 3d operation. */
   public static final String IMAGE_FUNCTION_3D_DESCRIPTION = "image.function.3d.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String IMAGE_FUNCTION_3D_ARG0_DESCRIPTION = "image.function.3d.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String IMAGE_FUNCTION_3D_ARG1_DESCRIPTION = "image.function.3d.arg1.description"; //$NON-NLS-1$
   /** Key for the description of the third argument. */
   public static final String IMAGE_FUNCTION_3D_ARG2_DESCRIPTION = "image.function.3d.arg2.description"; //$NON-NLS-1$
   /** Key for the description of the fourth argument. */
   public static final String IMAGE_FUNCTION_3D_ARG3_DESCRIPTION = "image.function.3d.arg3.description"; //$NON-NLS-1$

   /** Key for the description of the kmeans operation. */
   public static final String KMEANS_DESCRIPTION = "kmeans.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String KMEANS_ARG0_DESCRIPTION = "kmeans.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String KMEANS_ARG1_DESCRIPTION = "kmeans.arg1.description"; //$NON-NLS-1$
   /** Key for the description of the third argument. */
   public static final String KMEANS_ARG2_DESCRIPTION = "kmeans.arg2.description"; //$NON-NLS-1$
   /** Key for the description of the fourth argument. */
   public static final String KMEANS_ARG3_DESCRIPTION = "kmeans.arg3.description"; //$NON-NLS-1$
   /** Key for the error message saying that the number of clusters and the number of color in the color map do not match. */
   public static final String KMEANS_BAD_CLUSTERS = "kmeans.bad.clusters"; //$NON-NLS-1$
   /** Key for the error message saying that the color map is not rectangular. */
   public static final String KMEANS_COLOR_MAP_NOT_RECTANGULAR = "kmeans.color.map.not.rectangular"; //$NON-NLS-1$
   /** Key for the error message saying that the color map does not have the required number of bands. */
   public static final String KMEANS_BAD_BANDS = "kmeans.bad.bands"; //$NON-NLS-1$

   /** Key for the description of the precision operation. */
   public static final String PRECISION_RECALL_DESCRIPTION = "precision+recall.description"; //$NON-NLS-1$
   /** Key for the description of the first argument. */
   public static final String PRECISION_RECALL_ARG0_DESCRIPTION = "precision+recall.arg0.description"; //$NON-NLS-1$
   /** Key for the description of the second argument. */
   public static final String PRECISION_RECALL_ARG1_DESCRIPTION = "precision+recall.arg1.description"; //$NON-NLS-1$
   /** Key for the description of the third argument. */
   public static final String PRECISION_RECALL_ARG2_DESCRIPTION = "precision+recall.arg2.description"; //$NON-NLS-1$
   /** Key for the description of the fourth argument. */
   public static final String PRECISION_RECALL_ARG3_DESCRIPTION = "precision+recall.arg3.description"; //$NON-NLS-1$
   /** Key for the description of the fifth argument. */
   public static final String PRECISION_RECALL_ARG4_DESCRIPTION = "precision+recall.arg4.description"; //$NON-NLS-1$
   /** Key for the description of the sixth argument. */
   public static final String PRECISION_RECALL_ARG5_DESCRIPTION = "precision+recall.arg5.description"; //$NON-NLS-1$
   /** Key for the error message saying that the color of the class does not have the same number of bands as its image. */
   public static final String PRECISION_RECALL_BAD_BANDS = "precision+recall.bad.bands"; //$NON-NLS-1$


   /** Key for the error message saying the source is not a rendered image. */
   public static final String NOT_A_RENDERED_IMAGE = "not.a.rendered.image"; //$NON-NLS-1$
   /** Key for the error message saying the source is not a renderable image. */
   public static final String NOT_A_RENDERABLE_IMAGE = "not.a.renderable.image"; //$NON-NLS-1$
   /** Key for the error message saying the source is neither a rendered nor a renderable image. */
   public static final String NEITHER_RENDERED_NOR_RENDERABLE_IMAGE = "neither.rendered.nor.renderable.image"; //$NON-NLS-1$


//---------------------------
// Constructor
//---------------------------

   /**
    * Let no one instanciate this class.
    */
   private Resources() {
   // nothing
      }


//---------------------------
// Class method
//---------------------------

   /**
    * Gets the resource bundle itself.
    * @return   the resource bundle.
    */
   public static ResourceBundle getResourceBundle() {
      String name = Resources.class.getName();
      ResourceBundle bundle = ResourceBundle.getBundle(name, CharsetPropertiesControl.UTF_8_CONTROL);
      return bundle;
      }

   /**
    * Gets and formats the specified localized string from the menu resource
    * bundle.
    * @param   key   the key.
    * @param   arguments   the arguments to format the string.
    * @return   the value.
    */
   public static String getLocalizedString(String key, Object... arguments) {
      ResourceBundle bundle = Resources.getResourceBundle();
      String pattern = bundle.getString(key);
      String message = MessageFormat.format(pattern, arguments);
      return message;
      }

   }
